


import { memo } from 'react'

const SlowList = memo(function SlowList({text}){

    let item = []
    for(let i = 0; i < 250; i++){
        item.push(<SlowItem key={i} text={text} />)
    }

    return (
        <ul className='items'>
            {item}
        </ul>
    )
})

function SlowItem({text}){
    let startTime = performance.now();
    while (performance.now() - startTime < 1){
        // 这是卡顿操作
    }

    return (
        <li className='item'>
            Text:{text}
        </li>
    )
}

export default SlowList